import { request } from '@/utils/request'

export interface courseResponse {
  data: {
    code: number | string
    data: {}
    msg: string
  }
}

// 获取正在进行中的课程
export async function getCourseInProgress(): Promise<courseResponse> {
  return request({
    url: '/stuclient/api/studentClient/getCourseInProgress',
    method: 'get',
  })
}

// 获取课后作业
export async function getHomework(params): Promise<courseResponse> {
  return request({
    url: '/stuclient/api/homework/getHomeworkListInfo',
    method: 'get',
    params,
  })
}

// 获取课后作业详情
export async function getHomeworkDetail(params): Promise<courseResponse> {
  return request({
    url: '/stuclient/api/homework/getHomeworkDetailInfo',
    method: 'get',
    params,
  })
}
// 课程-获取学生分组列表
export async function getStudentGroupRequest(params): Promise<courseResponse> {
  return request({
    url: '/stuclient/api/grouping/getStudentGroupList',
    method: 'get',
    params,
  })
}

//课程-举手
export async function raiseHandRequest(data): Promise<courseResponse> {
  return request({
    url: '/stuclient/api/studentClient/raiseHand',
    method: 'post',
    data,
  })
}

// 课程-获取学生分组详情
export async function getStudentGroupDetailRequest(params): Promise<courseResponse> {
  return request({
    url: '/stuclient/api/grouping/getStudentGroupSubmitInfo',
    method: 'get',
    params,
  })
}

// 课程-小组练习提交
export async function commitGroupPractiseRequest(data): Promise<courseResponse> {
  return request({
    url: '/stuclient/api/grouping/groupPracticeSubmit',
    method: 'post',
    data,
  })
}

// 课程-获取学生分组AI解析详情
export async function getStudentGroupAnalysisRequest(params): Promise<courseResponse> {
  return request({
    url: '/stuclient/api/grouping/getGroupSubmitAnalysisInfo',
    method: 'get',
    params,
  })
}
